package com.vayne.bean;

import java.util.Random;
import java.util.UUID;

/**
 * Setter / Getter
 * Setter 称为 Writeable(可写的)
 * Getter 称为 Readable(可读的)
 * 属性 称为 Property
 *
 * @author xuerui.zhang
 * @since 2019/12/30 上午10:31
 */
public class Person {

    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static Person createPerson() {
        Person person = new Person();
        person.setName(UUID.randomUUID().toString());
        person.setAge(new Random().nextInt(100));
        return person;
    }
}
